Positioning Method and Apparatus

ABSTRACT

This application discloses a positioning method and an apparatus, and relates to the field of communications technologies. The positioning method and the apparatus are invented to resolve a prior-art problem of a relatively low success rate of obtaining an assisted location. The method includes: determining, by a terminal, identifiers of M target signal sources, where a value of M is an integer greater than 1, and the target signal source is a signal source whose signal strength currently can be detected by the terminal and is greater than a preset threshold; obtaining, based on the identifiers of the M target signal sources, a location matching the identifiers of the M target signal sources; and performing, by the terminal, satellite positioning based on the location. This application is applied to a satellite positioning process.

This application claims priority to Chinese Patent Application No.201710222015.6, filed with the Chinese Patent Office on Apr. 6, 2017 andentitled “POSITIONING METHOD AND DEVICE FOR TERMINAL”, which isincorporated herein by reference in its entirety.

TECHNICAL FIELD

This application relates to the field of communications technologies,and in particular, to a positioning method and an apparatus.

BACKGROUND

A location based service (Location Based Service, LBS) is a value-addedservice for obtaining location information (such as geographiccoordinates) of a terminal user by using various positioningtechnologies, and providing a corresponding service to the user withsupport of a geographic information system (Geographic InformationSystem, GIS) platform. As the location based service is more widelyapplied, the user also has an increasingly high positioning requirement.A Global Positioning System (Global Positioning System, GPS) is used asa common positioning technology, and a GPS time to first fix (Time toFirst Fix, TTFF) is a key factor affecting positioning. The GPS time tofirst fix is a time required by a terminal having a GPS positioningfunction from starting of GPS positioning to successful positioning.

To reduce the GPS time to first fix, at present, a widely usedpositioning method includes: obtaining, by a terminal, an assistedlocation, and searching for and tracking a satellite based on theobtained assisted location, to accomplish first positioning. In theprior art, a method for obtaining an assisted location includes:prestoring, by a terminal, a mapping relationship among a cellidentifier, a location, and location frequency; and during positioning,obtaining, by the terminal, an identifier of a cell with which theterminal currently registers, searching the prestored mappingrelationship based on the cell identifier, to obtain all locationscorresponding to the cell with which a user currently registers, andusing a location that appears most frequently in all the locations, asan assisted location. However, an error may occur in such animplementation in the following cases. Consequently, an assistedlocation cannot be obtained.

As shown in FIG. 1 a, a physical distance between P and Q is short(within a range of several kilometers), but P and Q respectivelycorrespond to different cells with which registration is performed. Forexample, a cell with which registration is performed and thatcorresponds to P is a cell A, and a cell with which registration isperformed and that corresponds to Q is a cell B. When a terminal storesonly a mapping relationship between the cell A and a location at P (forease of description, the location at P is referred to as a location P),when the terminal moves to Q and requires GPS positioning, because theterminal obtains an identifier of the cell B, and fails to find amapping relationship corresponding to the cell B, a location assistancefunction cannot be accomplished. Actually, at Q, the location P can beused as an assisted location to assist positioning by the terminal.

As shown in FIG. 1 b, an area P is a cross coverage area of a cell A anda cell B. Therefore, when a terminal is in the area P, the terminal mayregister with different cells at different time. At a moment T1, theterminal registers with a cell A, and pre-obtains a location P of theterminal, so that the terminal stores a mapping relationship between thecell A and the location P at P; and at a moment T2, when the terminal islocated at P again and requires GPS positioning, an identifier, obtainedby the terminal, of a cell with which registration is currentlyperformed is an identifier of the cell B. Because a mapping relationshipcorresponding to the cell B is not found, a location assistance functioncannot be accomplished. Actually, the mapping relationship between thecell A and the location at P established during registration with thecell A can be used as location assistance information and provided forassisting positioning by the terminal.

SUMMARY

Embodiments of this application provide a positioning method and anapparatus, to resolve a prior-art problem of a relatively low successrate of providing an assisted location.

To achieve the foregoing objective, the following technical solutionsare used in the embodiments of this application.

According to a first aspect, a positioning method is provided. Themethod is applicable to a scenario in which satellite positioning isperformed, and the method includes: determining, by a terminal,identifiers of M target signal sources, where a value of M is an integergreater than 1, and the target signal source is a signal source whosesignal strength currently can be detected by the terminal and is greaterthan a preset threshold; then, obtaining, by the terminal based on theidentifiers of the M target signal sources, a location matching theidentifiers of the M target signal sources; and further, using, by theterminal, the location as an assisted location, and performing satellitepositioning based on the location.

The signal source in an embodiment of this application is a base stationthat can be detected by the terminal or an access point such as awireless router that can be detected by the terminal. A value of thepreset threshold may be set according to an actual requirement.

It can be learned that, in the foregoing method, when determining theassisted location, the terminal considers a plurality of signal sourcesthat currently can be detected, where the plurality of signal sourcesmay be signal sources currently accessed by the terminal, or may besignal sources neighboring to a currently accessed signal source, sothat when the assisted location is determined, if the assisted locationfails to be obtained based only on the currently accessed signal source,refer to a location corresponding to a neighboring signal source. Forexample, the location corresponding to the neighboring signal source isdetermined as the assisted location. Therefore, according to theforegoing method, a success rate of obtaining the assisted location canbe improved.

In a possible design, the obtaining, by the terminal based on theidentifiers of the M target signal sources, a location matching theidentifiers of the M target signal sources includes: determining, by theterminal, a current signal source integrated identifier based on theidentifiers of the M target signal sources, where the current signalsource integrated identifier consists of the identifiers of the M targetsignal sources; further, determining, by the terminal, a target signalsource integrated identifier matching the current signal sourceintegrated identifier, and a location corresponding to the target signalsource integrated identifier; and determining the location correspondingto the target signal source integrated identifier as the locationmatching the identifiers of the M target signal sources, namely, acurrent assisted location of the terminal, and performing positioningbased on the current assisted location.

The determining, by the terminal, a current signal source integratedidentifier includes: sequentially arranging, by the terminal, theidentifiers of the M target signal sources based on signal strengths ofthe signal sources, and then generating the current signal sourceintegrated identifier.

The preset threshold may be set according to an actual requirement. Forthe current signal source integrated identifier, a set consisting of theidentifiers of the M target signal sources may be used as a signalsource integrated identifier, the identifier of each of the M targetsignal sources is an element in the set, and the elements in the set maybe sequentially arranged based on the signal strengths, for example,arranged based on a descending order or an ascending order of the signalstrengths.

It can be learned that, in the foregoing method, when the assistedlocation is determined, the current signal source integrated identifieris determined first, and then, the location corresponding to the targetsignal source integrated identifier that can match the current signalsource integrated identifier is determined as the current assistedlocation; and positioning is performed based on the current assistedlocation. The assisted location is determined based on the signal sourceintegrated identifier, and the signal source integrated identifierconsists of the identifiers of the M signal sources whose signalstrengths can be detected by the terminal and are greater than thepreset threshold. Therefore, the signal source integrated identifier canreflect a relationship between the terminal and coverage of theplurality of signal sources, and indicates that the terminal may belocated within the coverage of the plurality of signal sources. In thisway, when the assisted location is determined, compared with the priorart in which only a cell with which a terminal registers is considered,in the method provided in this embodiment of this application, theplurality of signal sources are comprehensively considered, so that alocation corresponding to another signal source, for example, a locationcorresponding to a neighboring cell of the terminal, can be determinedas the assisted location, thereby improving the success rate ofobtaining the assisted location by the terminal.

In a possible design, the terminal locally stores a mapping relationshipbetween a signal source integrated identifier and a location; and theterminal searches the stored mapping relationship for the target signalsource integrated identifier whose similarity to the current signalsource integrated identifier satisfies a preset condition, and thelocation corresponding to the target signal source integratedidentifier, and uses the location as the location matching theidentifiers of the M target signal sources, namely, the current assistedlocation of the terminal.

In the implementation, the terminal locally prestores the mappingrelationship between a signal source integrated identifier and alocation. Therefore, the terminal does not need to interact with anetwork side or another device, and even if in a non-networked state,after determining the current signal source integrated identifier, theterminal searches the stored mapping relationship, to determine alocation corresponding to a signal source integrated identifier similarto the current signal source integrated identifier as the assistedlocation.

In a possible design, the preset condition in this embodiment of thisapplication includes: the target signal source integrated identifier isa signal source integrated identifier including at least N same signalsource identifiers as the current signal source integrated identifier. Avalue of N is an integer greater than or equal to 1 and less than orequal to M.

When there are at least two signal source integrated identifiers eachincluding at least N same signal source identifiers as the currentsignal source integrated identifier, the preset condition furtherincludes: the target signal source integrated identifier is a signalsource integrated identifier that includes the largest quantity of samesignal source identifiers as the current signal source integratedidentifier, where the signal source integrated identifier is in the atleast two signal source integrated identifiers.

In a possible design, the terminal further stores an establishment timeof the mapping relationship between a signal source integratedidentifier and a location; and when there are at least two signal sourceintegrated identifiers each including at least N same signal sourceidentifiers as the current signal source integrated identifier, thepreset condition further includes: the target signal source integratedidentifier is a signal source integrated identifier with the latestestablishment time of the mapping relationship, where the signal sourceintegrated identifier is in the at least two signal source integratedidentifiers.

In a possible design, after the performing, by the terminal, satellitepositioning based on the current assisted location, the method furtherincludes: determining, by the terminal, whether a mapping relationshipcorresponding to the current signal source integrated identifier islocally stored; and if yes, updating, by the terminal to a locationcorresponding to the current signal source integrated identifier, acurrent location of the terminal obtained after the satellitepositioning; or if not, storing, by the terminal, a mapping relationshipbetween the current signal source integrated identifier and a. currentlocation of the terminal obtained after the satellite positioning.According to the design manner, the terminal can update the mappingrelationship between a signal source integrated identifier and alocation in real time during the satellite positioning.

With reference to the foregoing possible design manners, in a possibledesign, another implementation of the obtaining, by the terminal, alocation matching the identifiers of the M signal sources includes:sending, by the terminal, a current signal source integrated identifierto a network device, determining, by the network device based on thecurrent signal source integrated identifier, a target signal sourceintegrated identifier whose similarity to the current signal sourceintegrated identifier satisfies a preset condition, and a locationcorresponding to the target signal source integrated identifier; andsending, by the network device, the target signal source integratedidentifier and the location corresponding to the target signal sourceintegrated identifier to the terminal.

The network device may be a network positioning server, or a devicelocated on a core network side. In the implementation, the networkdevice stores the mapping relationship between a signal sourceintegrated identifier and a location. The network device determines,based on the current signal source integrated identifier by searchingthe stored mapping relationship, the target signal source integratedidentifier and the location corresponding to the target signal sourceintegrated identifier, and sends the target signal source integratedidentifier and the location corresponding to the target signal sourceintegrated identifier to the terminal. For a specific implementation ofdetermining, by the network side device, the target signal sourceintegrated identifier, refer to the foregoing possible designs in whichthe terminal determines the target signal source integrated identifier.According to the implementation, the network side device undertakes aprocessing process of determining the target signal source integratedidentifier, thereby saving memory of the terminal, and reducingoccupation of resources of the terminal.

According to a second aspect, a terminal is provided. The terminalincludes: a determining unit, configured to determine identifiers of Mtarget signal sources, where a value of M is an integer greater than 1,and the target signal source is a signal source whose signal strengthcurrently can be detected by the terminal and is greater than a presetthreshold; an obtaining unit, configured to obtain, based on theidentifiers of the M target signal sources determined by the determiningunit, a location matching the identifiers of the M target signalsources; and a positioning unit, configured to perform satellitepositioning based on the location obtained by the obtaining unit.

In a possible design, the determining unit is specifically configured todetermine a current signal source integrated identifier, where thecurrent signal source integrated identifier consists of the identifiersof the M target signal sources; and the obtaining unit is specificallyconfigured to: obtain a target signal source integrated identifiermatching the current signal source integrated identifier determined bythe determining unit, and a location corresponding to the target signalsource integrated identifier; and determine the location correspondingto the target signal source integrated identifier as the locationmatching the identifiers of the M target signal sources.

In a possible design, the determining unit is further configured to:sequentially arrange the identifiers of the M target signal sourcesbased on signal strengths of the signal sources, and then generate thecurrent signal source integrated identifier.

In a possible design, the terminal further includes a storage unit,configured to store a mapping relationship between a signal sourceintegrated identifier and a location; and the obtaining unit is furtherconfigured to search the mapping relationship stored by the storage unitfor the target signal source integrated identifier whose similarity tothe current signal source integrated identifier satisfies a presetcondition, and the location corresponding to the target signal sourceintegrated identifier.

In a possible design, the preset condition includes: the target signalsource integrated identifier is a signal source integrated identifierincluding at least N same signal source identifiers as the currentsignal source integrated identifier, where a value of N is an integergreater than or equal to 1 and less than or equal to M.

In a possible design, when there are at least two signal sourceintegrated identifiers each including at least N same signal sourceidentifiers as the current signal source integrated identifier, thepreset condition further includes: the target signal source integratedidentifier is a signal source integrated identifier that includes thelargest quantity of same signal source identifiers as the current signalsource integrated identifier, where the signal source integratedidentifier is in the at least two signal source integrated identifiers.

In a possible design, the storage unit is further configured to store anestablishment time of the mapping relationship between a signal sourceintegrated identifier and a location; and when there are at least twosignal source integrated identifiers each including at least N samesignal source identifiers as the current signal source integratedidentifier, the preset condition further includes: the target signalsource integrated identifier is a signal source integrated identifierwith the latest establishment time of the mapping relationship, wherethe signal source integrated identifier is in the at least two signalsource integrated identifiers.

In a possible design, the determining unit is further configured to:determine whether a mapping relationship corresponding to the currentsignal source integrated identifier is locally stored; and if themapping relationship corresponding to the current signal sourceintegrated identifier is stored, update, to a location corresponding tothe current signal source integrated identifier, a current location ofthe terminal obtained after the positioning by the positioning unit; orif the mapping relationship corresponding to the current signal sourceintegrated identifier is not stored, the storage unit stores a mappingrelationship between the current signal source integrated identifier anda current location of the terminal obtained after the positioning by thepositioning unit.

According to a third aspect, a terminal is provided. The terminalincludes a processor and a memory, where the memory stores aninstruction, and the processor is configured to execute the instructionstored in the memory, to perform the method according to the foregoingaspect.

According to a fourth aspect, a computer-readable storage medium isprovided. The computer-readable storage medium stores an instruction,and when the computer-readable storage medium is run on a computer, thecomputer is enabled to perform the method according to the foregoingaspect.

According to a fifth aspect, a computer program product is provided. Thecomputer program product includes an instruction, and when the computerprogram product is run on a computer, the computer is enabled to performthe method according to the foregoing aspect.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1a and FIG. 1b are schematic diagrams each showing that aneffective assisted location cannot be provided when an assisted locationis provided by using a method in the prior art;

FIG. 2a is a schematic diagram of an application scenario according toan embodiment of this application;

FIG. 2b is a schematic structural diagram of a mobile phone according toan embodiment of this application;

FIG. 3a is a flowchart of a positioning method according to anembodiment of this application;

FIG. 3b is a flowchart of another positioning method according to anembodiment of this application;

FIG. 4a is a flowchart of a method for determining a current signalsource integrated identifier according to an embodiment of thisapplication;

FIG. 4b is a flowchart of a method for determining a target signalsource integrated identifier matching a current signal source integratedidentifier according to an embodiment of this application;

FIG. 5 is a schematic diagram of an application scenario according to anembodiment of this application;

FIG. 6 is a flowchart of a method for updating a mapping relationshipbetween a signal source integrated identifier and a. location accordingto an embodiment of this application;

FIG. 7a is a schematic diagram. of a process of applying a positioningmethod to an actual scenario according to an embodiment of thisapplication;

FIG. 7b is a schematic diagram of a process of applying a positioningmethod to an actual scenario according to an embodiment of thisapplication;

FIG. 8a is a schematic structural diagram of a terminal according to an.embodiment of this application;

FIG. 8b is a schematic structural diagram of another terminal accordingto an embodiment of this application; and

FIG. 8c is a schematic structural diagram of still another terminalaccording to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

In the embodiments of this application, the term “plurality” means twoor more. In the embodiments of this application, the terms such as“first” and “second” are merely used to distinguish between differentobjects, and are not intended to limit a sequence thereof. For example,a first condition and a second condition are merely used to distinguishbetween different conditions, and are not intended to limit a sequencethereof. In the embodiments of this application, the term “and/or”describes only an association relationship for describing associatedobjects and represents that three relationships may exist. For example,A and/or B may represent the following three cases: Only A exists, bothA and B exist, and only B exists. In addition, in the embodiments ofthis application, the character “/” generally indicates an “or”relationship between the associated objects.

At present, during use of a terminal by a user, a location based serviceis more widely applied. As shown in FIG. 2 a, a current geographicallocation of the terminal is determined first, and then names andaddresses of a hotel, a cinema, a library, a gas station, and the likewithin a particular range from the location are provided for the user.Various positioning technologies are used in these location basedservices. Therefore, the user also has an increasingly high positioningrequirement. A positioning speed is a key factor affecting positioning.At present, common positioning technologies in which positioning isperformed by using a satellite system include: Beidou positioning, GPSpositioning, Galileo positioning, a Global Navigation Satellite System(Global Navigation Satellite System, GLONASS), and the like. To increasethe positioning speed, an embodiment of this application provides apositioning method, mainly applied to a process in which a terminalperforms positioning by using a satellite system.

The terminal in the embodiments of this application can performpositioning by using a satellite system. The terminal may be a devicesuch as a mobile phone, a tablet computer, a notebook computer, anultra-mobile personal computer (Ultra-mobile Personal Computer, UMPC), anetbook, a personal digital assistant (Personal Digital Assistant, PDA),an in-vehicle navigator, or a wearable device.

Using an example in which the terminal is a mobile phone, as shown inFIG. 2 b, the mobile phone 100 includes components such as a radiofrequency (radio frequency, RF) circuit 110, a memory 120, an input unit130, a positioning module 140, a processor 150, a power supply 160, adisplay unit 170, a gravity sensor 180, and an audio circuit 190. Aperson skilled in the art may understand that a structure of the mobilephone shown in FIG. 2b does not constitute a limitation to the mobilephone, and the mobile phone may include more or fewer components thanthose shown in the figure, or some components may be combined, ordifferent component arrangements may be used.

Functional components of the mobile phone 100 are separately describedbelow:

The RF circuit 110 may be configured to receive and send signals in aninformation receiving and sending process or a call process.Particularly, the RF circuit 110 receives downlink information from abase station, then delivers the downlink information to the processor150 for processing, and additionally sends uplink data to the basestation. Generally, the RF circuit includes, but is not limited to: anantenna, at least one amplifier, a transceiver, a coupler, a low noiseamplifier (low noise amplifier, LNA), a duplexer, and the like. Inaddition, the RF circuit 110 may communicate with a network and anotherdevice by wireless communication. The wireless communication may use anycommunication standard or protocol, including, but not limited to, aGlobal System for Mobile Communications (global system of mobilecommunication, GSM), a general packet radio service (general packetradio service, GPRS), Code Division Multiple Access (code divisionmultiple access, CDMA), Wideband Code Division Multiple Access (widebandcode division multiple access, WCDMA), Long Term Evolution (long termevolution, LTE), an email, and a short messaging service (shortmessaging service, SMS).

The memory 120 may be configured to store a software program and module.The processor 150 runs the software program and module stored in thememory 120, to implement various functional applications and dataprocessing of the mobile phone 100. The memory 120 may mainly include aprogram storage area and a data storage area. The program storage areamay store an operating system, an application program (Application, APP)required by at least one function such as a sound playback function andan image display function. The data storage area may store data (such asaudio data, image data, and an address book) created based on use of themobile phone 100, and the like. In addition, the memory 120 may includea high speed random access memory, and may further include anon-volatile memory, such as at least one magnetic disk storage device,a flash memory, or another volatile solid-state storage device.

The input unit 130 may be configured to: receive entered digit orcharacter information, and generate a key signal input related to a usersetting and function control of the mobile phone 100. Specifically, theinput unit 130 may include a touchscreen 131 and another input device132. The touchscreen 131, which is also referred to as a touch panel,may collect a touch operation of a user on or near the touchscreen 131(such as an operation of the user on or near the touchscreen 131 byusing any suitable object or accessory such as a finger or a stylus),and drive a corresponding connection apparatus according to a presetprogram. Optionally, the touchscreen 131 may include two parts: a touchdetection apparatus and a touch controller. The touch detectionapparatus detects a touch position of the user, detects a signalgenerated by the touch operation, and transfers the signal to the touchcontroller. The touch controller receives touch information from thetouch detection apparatus, converts the touch information into touchpoint coordinates, and sends the touch point coordinates to theprocessor 150. Moreover, the touch controller can receive and execute acommand sent from the processor 150. In addition, the touchscreen 131may be implemented in various types such as a resistance type, acapacitance type, an infrared type, and a surface acoustic wave type. Inaddition to the touchscreen 131, the input unit 130 may include theanother input device 132. Specifically, the another input device 132 mayinclude, but is not limited to, one or more of a physical keyboard, afunctional key (such as a volume control key or a switch key), atrackball, a mouse, or a joystick.

The positioning module 140 is a module having a positioning function,and may be a Beidou positioning module, a GPS positioning module, aGalileo positioning module, or a Global Navigation Satellite System(Global Navigation Satellite System, GLONASS) module. The positioningmodule may be integrally packaged or may be an independent chip. Themobile phone 100 may perform positioning by using the positioning module140.

The display unit 170 may be configured to display information entered bythe user or information provided for the user, and various menus of themobile phone 100. The display unit 170 may include a display panel 171.Optionally, the display panel 171 may be configured by using a liquidcrystal display (Liquid Crystal Display, LCD), an organic light-emittingdiode (Organic Light-Emitting Diode, OLED), or the like. Further, thetouchscreen 131 may cover the display panel 171. After detecting a touchoperation on or near the touchscreen 131, the touchscreen 131 transfersthe touch operation to the processor 150, to determine a type of a touchevent. Then, the processor 150 provides a corresponding visual output onthe display panel 171 based on the type of the touch event. Although, inFIG. 2 b, the touchscreen 131 and the display panel 171 are used as twoseparate parts to implement input and output functions of the mobilephone 100, in some embodiments, the touchscreen 131 and the displaypanel 171 may be integrated to implement the input and output functionsof the mobile phone 100.

The gravity sensor (gravity sensor) 180 may detect magnitude ofacceleration of the mobile phone in various directions (which aregenerally tri-axial), may detect magnitude and a direction of gravitywhen the mobile phone is static, and may be used for an application thatidentifies a mobile phone gesture (for example, switching between ahorizontal screen and a vertical screen, a related game, andmagnetometer gesture calibration), a function related to vibrationidentification (for example, a pedometer and a knock), and the like.

The mobile phone 100 may further include another sensor, for example, anoptical sensor. Specifically, the optical sensor may include an ambientlight sensor and an optical proximity sensor. The ambient light sensormay adjust brightness of the display panel 131 based on brightness ofambient light. The optical proximity sensor may detect whether there isan object approaching or touching the mobile phone, and may turn off thedisplay panel 131 and/or backlight when the mobile phone 100 is moved toan ear. Another sensor such as a gyroscope, a barometer, a hygrometer, athermometer, or an infrared sensor may further be configured in themobile phone 100. Details are not described herein.

The audio circuit 190, a speaker 191, and a microphone 192 may providean audio interface between a user and the mobile phone 100. The audiocircuit 190 may convert received audio data into an electrical signaland transmit the electrical signal to the speaker 191. The speaker 191converts the electrical signal into a sound signal for output. Inaddition, the microphone 192 converts a collected sound signal into anelectrical signal. The audio circuit 190 receives the electrical signal,converts the electrical signal into audio data, and outputs the audiodata to the RF circuit 110 to send the audio data to, for example,another mobile phone, or outputs the audio data to the memory 120 forfurther processing,

The processor 150 is a control center of the mobile phone 100, and isconnected to various parts of the mobile phone by using variousinterfaces and lines. By running or executing the software programand/or the module stored in the memory 120, and invoking data stored inthe memory 120, the processor 150 performs various functions and dataprocessing of the mobile phone 100, thereby performing overallmonitoring on the mobile phone. Optionally, the processor 150 mayinclude one or more processing units. Optionally, the processor 150 mayintegrate an application processor and a modem processor. Theapplication processor mainly processes an operating system, a userinterface, an application program, and the like. The modem processormainly processes wireless communication. It may be understood that theforegoing modem processor may alternatively not be integrated into theprocessor 150.

The mobile phone 100 further includes the power supply 160 (such as abattery) for supplying power to the components. Optionally, the powersupply may be logically connected to the processor 150 by using a powermanagement system, thereby implementing functions such as charging,discharging and power consumption management by using the powermanagement system.

Although not shown in the figure, the mobile phone 100 may furtherinclude an antenna, a Wireless Fidelity (Wireless-Fidelity, Wi-Fi)module, a Near Field Communication (Near Field Communication, NFC)module, a Bluetooth module, a speaker, an accelerometer, a gyroscope,and the like.

An embodiment of this application provides a positioning method,applicable to the foregoing application scenario and terminal, andespecially applicable to a process of assisting satellite positioningduring the satellite positioning, for example, applicable to assistedGPS (Assisted GPS, A-GPS) positioning. As shown in FIG. 3 a, the methodincludes the following steps.

Step 201: The terminal determines identifiers of M target signalsources.

The signal source in this embodiment of this application may be a basestation, a cellular cell (cell), and other types of access points(Access Point, AP) such as a wireless routing device and a device as ahotspot. A value of M is an integer greater than 1, and the targetsignal source is a signal source whose signal strength currently can bedetected by the terminal and is greater than a preset threshold. Thepreset threshold may be set according to an actual requirement.

Step 202: The terminal obtains, based on the identifiers of the M targetsignal sources, a location matching the identifiers of the M targetsignal sources.

The location is an assisted location used to assist satellitepositioning.

Step 203: The terminal performs satellite positioning based on thelocation.

Optionally, the terminal may directly use the location obtained in step202 as an ultimate satellite positioning result.

Optionally, after determining the assisted location, the terminal mayrapidly track a satellite by using the assisted location, to implementpositioning. For the specific implementation process, refer to the priorart, and details are not described in this embodiment of thisapplication.

It can be learned that, in the foregoing method, when determining theassisted location, the terminal considers a plurality of signal sourcesthat currently can be detected, where the plurality of signal sourcesmay be signal sources currently accessed by the terminal, or may besignal sources neighboring to a currently accessed signal source, sothat when the assisted location is determined, if the assisted locationfails to be obtained based only on the currently accessed signal source,refer to a location corresponding to a neighboring signal source. Forexample, the location corresponding to the neighboring signal source isdetermined as the assisted location. Therefore, according to theforegoing method, a success rate of obtaining the assisted location canbe improved.

Optionally, this embodiment of this application provides a possibleimplementation of step 202 of “obtaining, by the terminal based on theidentifiers of the M target signal sources, a location matching theidentifiers of the M target signal sources”. As shown in FIG. 3 b, themethod includes the following steps.

Step 301: The terminal determines a current signal source integratedidentifier based on the identifiers of the M target signal sources.

The current signal source integrated identifier consists of theidentifiers of the M target signal sources.

For example, the signal source integrated identifier is indicated in aform of a one-dimensional matrix (set) consisting of the identifiers ofthe M target signal sources, and elements in the set may be randomlyarranged or may be sequentially arranged based on signal strengths. Forexample, the current signal source integrated identifier is [ID_(A)ID_(B) ID_(C) ID_(D)], where ID_(A), ID_(B), ID_(C), and ID_(D)respectively indicate identifiers of cells A, B, C, and D, and adescending order of signal strengths is: A>B>C>D. The current signalsource integrated identifier may alternatively be indicated in anotherform, for example, ID_(A)-ID_(C)-ID_(B)-ID_(D).

Step 302: The terminal determines a target signal source integratedidentifier matching the current signal source integrated identifier, anda location corresponding to the target signal source integratedidentifier.

Information about the location corresponding to the target signal sourceintegrated identifier is latitude and longitude information. A mappingrelationship between a signal source integrated identifier and locationinformation is pre-established. Optionally, the pre-established mappingrelationship may exist in a form of a mapping relationship table.Optionally, the mapping relationship table may be locally stored in theterminal, so that when performing the step, the terminal searches thelocally stored mapping relationship table for the target signal sourceintegrated identifier and the location corresponding to the targetsignal source integrated identifier. In the implementation, whendetermining the target signal source integrated identifier and thelocation corresponding to the target signal source integratedidentifier, the terminal does not need to interact with another device,to be specific, does not depend on a network connection. In anon-networked state, the terminal can still obtain through matching thetarget signal source integrated identifier and the information about thelocation corresponding to the target signal source integratedidentifier.

Optionally, the mapping relationship table may be stored in a networkdevice. The network device may be a network positioning server or a corenetwork side device, so that when performing the step, the terminalsends the current signal source integrated identifier to the networkdevice, and the network device obtains through matching the targetsignal source integrated identifier and the location corresponding tothe target signal source integrated identifier

Optionally, in a possible implementation, the terminal determines asignal source integrated identifier whose similarity to the currentsignal source integrated identifier satisfies a preset condition as thetarget signal source integrated identifier, That a similarity to thecurrent signal source integrated identifier satisfies a preset conditionincludes: the target signal source integrated identifier and the currentsignal source integrated identifier include at least N same signalsource identifiers. A value of N may be greater than or equal to 1 andless than or equal to M. For the specific implementation, refer todetailed descriptions below.

In another implementation, in a special case, the current signal sourceintegrated identifier determined in step 301 includes only one signalsource identifier, for example, an identifier of a cell with which theterminal currently registers or an identifier of an access pointcurrently accessed by the terminal, so that the target signal sourceintegrated identifier matching the current signal source integratedidentifier in step 302 may be an identifier of a neighboring signalsource, for example, an identifier of a neighboring cell with whichregistration is not performed but whose signal strength can be detectedand is relatively high or an identifier of an access point that is notaccessed but whose signal strength can be detected and is relativelyhigh. For example, if the current signal source integrated identifierincludes only one signal source identifier, for example, the identifierID_(A) of the cell A, when the target signal source integratedidentifier is obtained through matching, an identifier that does notinclude the cell A but includes a cell that is a neighboring, cell ofthe cell A and has a relatively high signal strength (the signalstrength is greater than a particular threshold) is used as the targetsignal source integrated identifier through matching. For example, theidentifier ID_(B) of the cell B is determined as the target signalsource integrated identifier.

Step 303: The terminal determines the location corresponding to thetarget signal source integrated identifier as the location matching theidentifiers of the M target signal sources.

To be specific, the location corresponding to the target signal sourceintegrated identifier is determined as a current assisted location ofthe terminal.

According to the foregoing method, when the assisted location isdetermined, the current signal source integrated identifier isdetermined first, and then, the location corresponding to the targetsignal source integrated identifier that can match the current signalsource integrated identifier is determined as the current assistedlocation and positioning is performed based on the current assistedlocation. The assisted location is determined based on the signal sourceintegrated identifier, and the signal source integrated identifierconsists of the identifiers of the M signal sources whose signalstrengths can be detected by the terminal and are greater than thepreset threshold. Therefore, the signal source integrated identifier canreflect a relationship between the terminal and coverage of theplurality of signal sources, and indicates that the terminal may belocated within the coverage of the plurality of signal sources. In thisway, when the assisted location is determined, compared with the priorart in which only a cell with which a terminal registers is considered,in the method provided in this embodiment of this application, theplurality of signal sources are comprehensively considered, so that alocation corresponding to another signal source, for example, a locationcorresponding to a neighboring cell of the terminal, can be determinedas the assisted location, thereby improving the success rate ofobtaining the assisted location by the terminal.

Optionally, as shown in FIG. 4 a, an implementation of step 301 of“determining, by the terminal, a current signal source integratedidentifier based on the identifiers of the M target signal sources”includes the following steps.

Step 401: The terminal sequentially arranges the identifiers of the Mtarget signal sources based on signal strengths of the signal sources,and then generates the current signal source integrated identifier.

For example, when a signal source is a cell that can be detected by theterminal, it is assumed that the terminal can detect seven cells: A, B,C, D, E, F, and G, and signal strengths of the seven cells are shown inthe following Table 1. Therefore, the M target signal sources in thisembodiment of this application may be several or all of the seven cells,to be specific, the value of M is greater than or equal to 1 and lessthan or equal to 7. Using an example in which the value of M is 4, fourcells having higher signal strengths in the seven cells are respectivelythe cells A, C, B, and D, and identifiers corresponding to the cells arerespectively ID_(A), ID_(C), ID_(B), and ID_(D). Therefore, the signalsource integrated identifier in this embodiment of this application maybe obtained after the identifiers of the four cells are arrangedaccording to a particular rule, for example, obtained based on thesignal strengths of the four cells, and the determined current signalsource integrated identifier is ID_(A)-ID_(C)-ID_(B)-ID_(D).

It should be noted that, the terminal may obtain the signal identifierand the signal strength of each cell through routing and paging in acell or update of a positioned area or by using another method. For thespecific implementation, refer to the prior art, and details are notdescribed herein.

TABLE 1 Cell identifier Signal strength (dBm) ID_(A) −55 ID_(B) −65ID_(C) −57 ID_(D) −73 ID_(E) −90 ID_(F) −100 ID_(G) −87

For example, when a signal source is an access point (Access Point, AP)that can be detected by the terminal, for example, when the signalsource is a wireless router used by the terminal to establish a Wi-Fi(Wireless-Fidelity, Wireless Fidelity) connection, it is assumed thatthe terminal can detect six wireless routers: R1, R2, R3, R4, R5, andR6, and signal strengths of the six wireless routers are shown in thefollowing Table 2. Therefore, the M target signal sources in thisembodiment of this application may be several or all of the six wirelessrouters, to be specific, the value of M is greater than or equal to 1and less than or equal to 6. Using an example in which the value of M is3, based on the signal strengths of the six wireless routers, the threetarget signal sources are three wireless routers having highest signalstrengths, for example, the wireless routers 2, 1, and 3. Assuming thatbasic service set identifiers (Basic Service Set Identifier, BSSID)corresponding to the wireless routers 2, 1, and 3 are respectivelyBSSID_(R2), BSSID_(R1), and BSSID_(R3), the signal source integratedidentifier in this embodiment of this application may be obtained afterthe identifiers of the three wireless access points are arrangedaccording to a particular rule, for example, obtained based on thesignal strengths of the three wireless access points, and the signalsource integrated identifier in this embodiment of this application isBSSIID_(R2)-BSSID_(R1)-BSSID_(R3).

TABLE 2 Wireless access point identifier Signal strength (dBm)BSSID_(R1) −69 BSSID_(R2) −63 BSSID_(R3) −72 BSSID_(R4) −79 BSSID_(R5)−82 BSSID_(R6) −87 BSSID_(R7) −95

It should be noted that, the identifier of the wireless router isdescribed by using an example in Which the identifier is a BSSID. Inanother implementation, the identifier of the wireless router mayalternatively be a service set identifier (Service Set Identifier,SSID).

In another implementation, when the terminal can detect signal strengthsof a plurality of different types of signal sources, for example, candetect not only signal strengths of a plurality of cells but also signalstrengths of a plurality of wireless routers, in addition to maintainingtwo different types of mapping relationships, the terminal may maintaina mapping relationship including both a cell identifier and a wirelessrouter identifier. In this case, the signal source integrated identifiermay include both a cell identifier and a wireless router identifier. Forexample, the signal source integrated identifier isID_(A)-ID_(C)-BSSID_(R2)-ID_(B)-BSSID_(R1)-BSSID_(R3)-ID_(D).

Optionally, the terminal locally stores a mapping relationship between asignal source integrated identifier and a location.

Therefore, as shown in FIG. 4 b, step 302 of “determining, by theterminal, a target signal source integrated identifier matching thecurrent signal source integrated identifier, and a locationcorresponding to the target signal source integrated identifier” may bespecifically implemented as follows:

Step 501: The terminal searches a stored mapping relationship for thetarget signal source integrated identifier whose similarity to thecurrent signal source integrated identifier satisfies a presetcondition, and the location corresponding to the target signal sourceintegrated identifier.

As shown in Table 3, when a signal source is a cell that can be detectedby the terminal, this embodiment of this application provides animplementation of the mapping relationship. As shown in Table 4, when asignal source is a wireless access point that can be detected by theterminal, this embodiment of this application provides an implementationof the mapping relationship. The terminal may maintain both the twotypes of mapping relationships.

Optionally, as shown in Table 3 and Table 4, the mapping relationshiptable may further store a generation time of each mapping relationship.

TABLE 3 Generation time of a Cell integrated identifier Location mappingrelationship ID_(A)-ID_(B)-ID_(D) X1 degrees north 2017 Jan. 1, 09:58latitude, and Y1 degrees east longitude ID_(A)-ID_(B)-ID_(H)-ID_(J) X2degrees north 2017 Jan. 1, 16:35 latitude, and Y2 degrees east longitudeID_(A)-ID_(B)-ID_(D)-ID_(J) X3 degrees north 2017 Jan. 2, 06:45latitude, and Y3 degrees east longitude ID_(A)-ID_(B)-ID_(C)-ID_(J) X4degrees north 2017 Jan. 2, 07:58 latitude, and Y5 degrees east longitude

TABLE 4 Wireless access point Generation time of a integrated identifierLocation mapping relationship BSSID_(R1)-BSSID_(R2)- X1 degrees north2017 Jan. 1, 09:58 BSSID_(R3) latitude, and Y1 degrees east longitudeBSSID_(R2)-BSSID_(R3) X2 degrees north 2017 Jan. 1, 16:35 latitude, andY2 degrees east longitude BSSID_(R1)-BSSID_(R3)- X3 degrees north 2017Jan. 2, 06:45 BSSID_(R4) latitude, and Y3 degrees east longitudeBSSID_(R2)-BSSID_(R4)- X4 degrees north 2017 Jan. 2, 07:58 BSSID_(R5)latitude, and Y5 degrees east longitude

The preset condition includes a first condition that the current signalsource integrated identifier and the target signal source integratedidentifier include at least N same signal source identifiers, where avalue of N is an integer greater than or equal to 1 and less than orequal to M. The value of N may be set according to an actual case. Forexample, if the current signal source integrated identifier consists offour cell identifiers, the value of N may be an integer greater than orequal to 1 and less than or equal to 4. When the signal sourceintegrated identifier consists of two cell identifiers, the value of Nmay be an integer greater than or equal to 1 and less than or equal to2.

When a plurality of signal source integrated identifiers all satisfy theforegoing first condition, the preset condition may further include anyone or more of the following conditions:

Second condition: A signal source integrated identifier that includesthe largest quantity of same signal source identifiers as the currentsignal source integrated identifier is determined as the target signalsource integrated identifier, where the signal source integratedidentifier is in the foregoing plurality of signal source integratedidentifiers satisfying the first condition.

For example, if the current signal source integrated identifier isID_(A)-ID_(B)-ID_(C)-ID_(d), assuming that the value of N is 2, and itis determined, by viewing the mapping table shown in Table 3, that thereare two candidate signal source integrated identifiers, which arerespectively ID_(A)-ID_(B)-ID_(H)-ID_(J) and ID_(A)-ID_(B)-ID_(D),satisfying the first condition, because ID_(A)-ID_(B)-ID_(D) and thecurrent signal source integrated identifier ID_(A)-ID_(B)-ID_(C)-ID_(d)include three same signal source identifiers: ID_(A), ID_(B), andID_(D), and ID_(A)-ID_(B)-ID_(H)-ID_(J) and the current signal sourceintegrated identifier ID_(A)-ID_(B)-ID_(C)-ID_(d) include only two samesignal source identifiers: ID_(A) and ID_(B), ID_(A)-ID_(B)-ID_(D) is anultimate target signal source integrated identifier.

When the signal source integrated identifier is generated bysequentially arranging the signal source identifiers based on the signalstrengths of the signal sources, the first condition further includesthe following third condition.

Third condition: A candidate signal source identifier that first matchesa signal source identifier included in the current signal sourceintegrated identifier is determined as the target signal sourceintegrated identifier.

For example, if the current signal source integrated identifier isID_(A)-ID_(B)-ID_(C)-ID_(D), assuming that the value of N is 3, and itis determined, by viewing the mapping table shown in Table 3, that thereare three signal source integrated identifiers, which are respectivelyID_(A)-ID_(B)-ID_(D), ID_(A)-ID_(B)-ID_(D)-ID_(J), andID_(A)-ID_(B)-ID_(C)-ID_(J), satisfying the first condition, becauseID_(A)-ID_(B)-ID_(C)-ID_(J) first matches ID_(C),ID_(A)-ID_(B)-ID_(C)-ID_(J) is determined as an ultimate target signalsource integrated identifier.

Optionally, when the mapping relationship table further includes anestablishment time of the mapping relationship between a signal sourceintegrated identifier and a location, the first condition furtherincludes the following fourth condition.

Fourth condition: A signal source integrated identifier with the latestestablishment time of the mapping relationship is determined as thetarget signal source integrated identifier.

For example, if the current signal source integrated identifier isID_(A)-ID_(B)-ID_(C)-ID_(D), assuming that the value of N is 3, and itis determined, by viewing the mapping table shown in Table 3, that thereare two signal source integrated identifiers, which are respectivelyID_(A)-ID_(B)-ID_(D) and ID_(A)-ID_(B)-ID_(C)-ID_(J), satisfying thefirst condition, and establishment time of mapping relationshipscorresponding to the two signal source integrated identifiers isrespectively Jan. 1, 2017, 09:58 and Jan. 2, 2017, 07:58, because theestablishment time (Jan. 2, 2017, 07:58) of the mapping relationshipcorresponding to ID_(A)-ID_(B)-ID_(C)-ID_(J) is the latest,ID_(A)-ID_(B)-ID_(C)-ID_(J) is determined as an ultimate target signalsource integrated identifier.

Optionally, when the signal source integrated identifier is indicated ina form of a matrix (a set may be considered as a one-dimensionalmatrix), a quantity of same elements in one-dimensional matricescorresponding to a stored signal source integrated identifier and thecurrent signal source integrated identifier may be determined throughcomparison, to determine the target signal source integrated identifier.A signal source integrated identifier corresponding to a matrixincluding the largest quantity of same elements as the matrixcorresponding to the current signal source integrated identifier isdetermined as the target signal source integrated identifier.

When there are a plurality of signal source integrated identifierssatisfying the foregoing condition, a signal source integratedidentifier corresponding to a matrix including the largest quantity ofsame elements at a same location as the matrix corresponding to thecurrent signal source integrated identifier is determined as the targetsignal source integrated identifier.

Alternatively, when a plurality of signal source integrated identifierssatisfying the first condition are obtained through matching, an elementat each location in each of the plurality of signal source integratedidentifiers obtained through matching may be compared with an element ateach location in the current signal source integrated identifier, and asignal source integrated identifier first matching a signal sourceidentifier having a higher signal strength is determined as the targetsignal source integrated identifier. For example, if the current signalsource integrated identifier is [ID_(A) ID_(B) ID_(C) ID_(D)], andsignal source integrated identifiers satisfying the first conditioninclude [ID_(B) ID_(D) ID_(C) ID_(J)] and [ID_(B) ID_(C) ID_(A) ID_(J)],matching is performed between elements in [ID_(B) ID_(D) ID_(C) ID_(J)]and elements in [ID_(A) ID_(B) ID_(C) ID_(D)], a first same elementobtained through matching is ID_(B), and a second same element obtainedthrough matching is ID_(D); and matching is performed between an elementat each location in [ID_(B) ID_(D) ID_(C) ID_(J)] and the elements in[ID_(A) ID_(B) ID_(C) ID_(D)], a first same element obtained throughmatching is ID_(B), and a second same element obtained through matchingis ID_(C). Because the terminal detects that the signal strength of thecell C is greater than the signal strength of the cell D, and [ID_(B)ID_(C) ID_(A) ID_(J)] first matches ID_(C), [ID_(B) ID_(C) ID_(A)ID_(J)] is determined as the target signal source integrated identifier.For a specific implementation of matching between elements in matrices,refer to the prior art, and details are not described herein.

The first condition, the second condition, the third condition, and thefourth condition may be combined with each other, and a candidate signalsource integrated identifier satisfying the largest quantity ofconstraint conditions is an ultimate target signal source integratedidentifier.

To more clearly describe the method provided in this embodiment of thisapplication, for example, as shown in Table 5, the mapping relationshiptable stores the following mapping relationship:

TABLE 5 Generation time of a Cell integrated identifier Location mappingrelationship ID_(A)-ID_(B) Location P 2017 Jan. 1, 09:58

When the method provided in this embodiment of this application isapplied to the scenario shown in FIG. 1 a, when the terminal moves to Qand requires positioning, the terminal determines that a current cellintegrated identifier is ID_(B)-ID_(A). Because the cell integratedidentifier and the identifier ID_(A)-ID_(B) stored in the mappingrelationship table both include the identifiers of the cell A and thecell B, the identifier ID_(A)-ID_(B) stored in the mapping relationshiptable is used as a. target cell integrated identifier, and a locationcorresponding to the target cell integrated identifier, namely, alocation P is used as an assisted location required during positioningat Q. It can be learned that, compared with the prior art, in thisapplication, the location P can be used as the assisted locationrequired during the positioning at Q, thereby implementing rapidpositioning at Q.

When the method provided in this embodiment of this application isapplied to the scenario shown in FIG. 1 b, when the terminal moves to Pagain and requires positioning, a current cell integrated identifier ofthe terminal is determined as ID_(B)-ID_(A) or ID_(A)-ID_(B) (which maybe specifically determined according to an actual case). Because thecell integrated identifier and the identifier ID_(A)-ID_(B) stored inthe mapping relationship table both include the identifiers of the cellA and the cell B, the identifier ID_(A)-ID_(B) stored in the mappingrelationship table is used as a target cell integrated identifier, and alocation corresponding to the target cell integrated identifier, namely,the location P stored in the mapping relationship table, is used as anassisted location required during positioning. It can be learned that,compared with the prior art in which because a current cell with whichregistration is performed is the cell B when the terminal moves to Qagain, the location P in the mapping relationship stored whenregistration is performed in the cell A cannot be used as an assistedlocation, in this embodiment of this application, the location P in thestored mapping relationship can be used as an assisted location, therebyimplementing rapid positioning when the terminal moves to P again.

For example, when the method provided in this embodiment of thisapplication is applied to a case shown in FIG. 5, when the terminal islocated at P, a location P, a cell identifier A, and a cell integratedidentifier, namely, ID_(A)-ID_(C)-ID_(B)-ID_(D) are obtained, and amapping relationship between the cell integrated identifier and thelocation P is established. When the terminal moves to Q and requirespositioning, the terminal collects the identifiers of the cells A, B, C,and D and the signal strengths, and generates a cell integratedidentifier based on a descending order of the signal strengths. In thiscase, the cell integrated identifier may be ID_(B)-ID_(A)-ID_(D)-ID_(C),and a cell identifier B may exist. In this case, although Q isrelatively close to P, but the cell identifiers are different, andaccording to the solution in the prior art, a location at Q cannot beobtained through matching, while if the method in this embodiment ofthis application is used, a similarity betweenID_(B)-ID_(A)-ID_(D)-ID_(C) and ID_(A)-ID_(C)-ID_(B)-ID_(D) conforms toa particular rule, and ID_(B)-ID_(A)-ID_(D)-ID_(C) can successfullymatch ID_(A)-ID_(C)-ID_(B)-ID_(D), so that the location P is used as anassisted location required during positioning at Q.

It can be learned that, in this embodiment of this application, when amapping relationship is established, instead of establishing a mappingrelationship between a cell with which the terminal registers and alocation, a correspondence between the cell integrated identifier inthis embodiment of this application and a location is established.Therefore, provided that the mapping relationship table stores a targetcell integrated identifier whose similarity to the current cellintegrated identifier satisfies a condition, a location corresponding tothe target cell integrated identifier can be determined as an assistedlocation.

During actual application, after the method provided in this embodimentof this application is used, because the assisted location can beprovided, after the assisted location is provided, the terminal canrapidly track a satellite near the assisted location, so that a speed oftracking the satellite by the terminal can be increased, to implementrapid satellite positioning. In open space (there is no high building orother obstacles around), a time to first fix of the terminal can bereduced by approximately 50%. In an occluded environment (adouble-sided/three-sided occlusion test), a time to first fix can bereduced by approximately 80% to 90%.

In conclusion, according to the positioning method provided in thisembodiment of this application, after determining the current signalsource integrated identifier, the terminal searches the mappingrelationship table storing the mapping relationship between a signalsource integrated identifier and a location, to determine a locationcorresponding to a signal source integrated identifier most similar tothe current signal source integrated identifier as an assisted location.It can be learned that, in the foregoing method provided in thisembodiment of this application, the assisted location is determinedbased on the signal source integrated identifier, and the signal sourceintegrated identifier consists of the identifiers of the M signalsources whose signal strengths can be detected by the terminal.Therefore, the signal source integrated identifier can reflect arelationship between the terminal and coverage of the plurality ofsignal sources, and indicates that the terminal may be located withinthe coverage of the plurality of signal sources. In this way, when theassisted location is determined, compared with the prior art in whichonly a cell with which a terminal registers is considered, in the methodprovided in this application, the plurality of signal sources arecomprehensively considered, and locations corresponding to the pluralityof signal sources can all be considered, to provide an effectiveassisted location.

In some embodiments, during initial establishment of the mapping tablestoring the mapping relationship between a signal source integratedidentifier and a location, location information may be obtained inanother positioning manner, for example, location information isobtained through Wi-Fi positioning or base station positioning, or byperforming positioning in another manner; and the corresponding signalsource integrated identifier of the terminal at the location isdetermined, to store the mapping relationship between a signal sourceintegrated identifier and a. location. Subsequently, the mapping tablestoring the mapping relationship may be continually updated according toan actual case, including deleting an existing mapping relationship,adding a new mapping relationship, or modifying a signal sourceintegrated identifier or a location in an existing mapping relationship.Therefore, after step 204 of “performing, by the terminal, satellitepositioning based on the location”, as shown in FIG. 6, the methodprovided in this embodiment of this application further includes thefollowing steps.

Step 601: The terminal determines whether a mapping relationshipcorresponding to the current signal source integrated identifier islocally stored.

If yes, the following step 602 is performed; or if not, the followingstep 603 is performed.

Step 602: The terminal updates, to a location corresponding to thecurrent signal source integrated identifier, a current location of theterminal obtained after the satellite positioning.

By performing step 602, when the terminal already stores the mappingrelationship between a current signal source integrated identifier and alocation, the location of the signal source integrated identifieralready stored in the mapping relationship table is replaced with a newlocation, to update the location corresponding to the signal sourceintegrated identifier.

Step 603: The terminal stores a mapping relationship between the currentsignal source integrated identifier and a current location of theterminal obtained after the satellite positioning.

By performing this step, when the terminal does not store the mappingrelationship between a current signal source integrated identifier and alocation, the mapping relationship between the current signal sourceintegrated identifier and the current location of the terminal obtainedafter the satellite positioning is added to the mapping relationshiptable as a new mapping relationship.

During actual application, the terminal may maintain both a mappingtable storing a mapping relationship between a wireless access pointintegrated identifier and a location (for ease of description, referredto as an AP-location mapping table for short), and a mapping tablestoring a mapping relationship between a cell integrated identifier anda location for ease of description, referred to as a cell-locationmapping table).

In this way, when the terminal can communicate with a base station, if asubscriber identification module (Subscriber Identification Module, SIM)card or an eSIM card is installed in the terminal (the SIM card is usedas an example for description below), and the SIM card is in aneffective state, the terminal can detect a signal strength and a signalidentifier of a surrounding cell, and further can view the cell-locationmapping table, to determine a target cell integrated identifier anddetermine an assisted location.

If the terminal cannot communicate with a base station, for example, noSIM card is installed in the terminal or an SIM card is in anineffective state, but the terminal enables a function of scanning awireless access point, to be specific, the terminal can detect anidentifier and a signal strength of a surrounding wireless access point,the terminal may view the AP-location mapping table, to determine atarget wireless access point integrated identifier and determine anassisted location.

If the terminal can communicate with a base station (for example, an SIMcard in the terminal is in an effective state) and the terminal enablesa function of scanning a wireless access point, in an optional manner,the AP-location mapping table or the cell-location mapping table israndomly selected to determine an assisted location. Because an AP hassmaller coverage and more accurate positioning is implemented by usingthe AP, in another optional manner, the AP-location mapping table isviewed first, and if an assisted location can be determined in theAP-location mapping table, the location is determined as the assistedlocation; or if an assisted location cannot be determined in theAP-location mapping table, the cell-location mapping table is viewed todetermine an assisted location.

Using an example in which the terminal is a mobile phone, with referenceto an actual application scenario, as shown in FIG. 7 a, the mobilephone maintains both the AP-location mapping table and the cell-locationmapping table. When a user requires positioning, if the user enables thefunction of scanning a wireless access point, the mobile phonedetermines a current wireless access point integrated identifier,searches the AP-location mapping table for a target wireless accesspoint integrated identifier whose similarity to the current wirelessaccess point integrated identifier satisfies a condition, and determinesa location corresponding to the target wireless access point integratedidentifier as an assisted location. If the user does not enable thefunction of scanning a wireless access point, as shown in FIG. 7 b, themobile phone determines a current cell integrated identifier, searchesthe cell-location mapping table for a target cell integrated identifierwhose similarity to the current cell integrated identifier satisfies acondition, and determines a location corresponding to the target cellintegrated identifier as an assisted location.

It may be understood that, to implement the foregoing functions, theterminal includes corresponding hardware structures and/or softwaremodules for performing the functions. A person skilled in the art may bevery easily aware that, in combination with the examples described inthe embodiments disclosed in the embodiments of this application, unitsand algorithm steps may be implemented by hardware or a combination ofhardware and computer software in this application. Whether a functionis performed by hardware or hardware driven by computer software dependson particular applications and design constraint conditions of thetechnical solutions. A person skilled in the art may use differentmethods to implement the described functions for each particularapplication, but it should not be considered that the implementationgoes beyond the scope of this application.

In the embodiments of this application, functional modules of theterminal may be divided according to the foregoing method examples. Forexample, functional modules may be divided corresponding to functions,or two or more functions may be integrated into one processing module.The integrated module may be implemented in a form of hardware, or maybe implemented in a form of a software functional module. It should benoted that module division in the embodiments of this application is anexample and is merely logical function division. During actualimplementation, there may be another division manner.

When the functional modules are divided by using correspondingfunctions, FIG. 8a is a possible schematic structural diagram of theterminal in the foregoing embodiments. The terminal 700 includes adetermining unit 701, an obtaining unit 702, a positioning unit 703, anda storage unit 704. The determining unit 701 is configured to supportthe terminal 700 in performing the process 201 in FIG. 3a and 601 inFIG. 6. The obtaining unit 702 is configured to support the terminal 700in performing the process 202 in FIG. 3 a, the processes 301, 302, and303 in FIG. 3 b, the process 401 in FIG. 4 a, and the process 501 inFIG. 4 b, and the positioning unit 703 is configured to support theterminal 700 in performing the process 203 in FIG. 3 a. The storage unit704 is configured to store a mapping relationship between a signalsource integrated identifier and a location.

When an integrated unit is used, FIG. 8b is a possible schematicstructural diagram of the terminal in the foregoing embodiments. Theterminal 800 includes a processing module 802 and a communicationsmodule 803. The processing module 802 is configured to control andmanage an action of the terminal. For example, the processing module 802is configured to support the terminal in performing the processes 201,202, and 203 in FIG. 3 a, the processes 301, 302, and 303 in FIG. 3 b,the process 401 in FIG. 4 a, the process 501 in FIG. 4 b, the processes601 and 602 in FIG. 6, and/or another process used for the technologiesdescribed in the embodiments of this application. A communicationsmodule 803 is configured to support communication between the terminaland another network entity, for example, communication with varioustypes of access points and base stations. The terminal may furtherinclude a storage module 801, configured to store program code and dataof the terminal.

The processing module 802 may be a processor or a controller, such as acentral processing unit (Central Processing Unit, CPU), ageneral-purpose processor, a digital signal processor (Digital SignalProcessor, DSP), an application-specific integrated circuit(Application-Specific Integrated Circuit, ASIC), a field programmablegate array (Field Programmable Gate Array, FPGA), or anotherprogrammable logical device, a transistor logical device, a hardwarecomponent, or a combination thereof. The controller/processor mayimplement or execute various example logical blocks, modules, andcircuits described with reference to content disclosed in thisapplication. Alternatively, the processor may he a combination ofprocessors implementing a computing function, for example, a combinationof one or more microprocessors, or a combination of the DSP and amicroprocessor. The communications module 803 may he a transceiver, atransceiver circuit, a communications interface, or the like. Thestorage module 801 may be a memory.

When the processing module 802 is a processor, the communications module803 is a transceiver. When the storage module 801 is a memory, theterminal in this embodiment of this application may be a terminal shownin FIG. 8 c.

As shown in FIG. 8 c, the terminal 900 includes a processor 902, atransceiver 903, a memory 901, and a bus 904. The transceiver 903, theprocessor 902, and the memory 901 are connected to each other by usingthe bus 904. The bus 904 may be a peripheral component interconnect(Peripheral Component Interconnect, PCI) bus, an extended industrystandard architecture (Extended Industry Standard Architecture, EISA)bus, or the like. The bus may be classified into an address bus, a databus, a control bus, and the like. For ease of representation, only onebold line is used for representation in FIG. 8 c, but this does not meanthat there is only one bus or only one type of bus.

Method or algorithm steps described in combination with the contentdisclosed in this application may be implemented by hardware, or may beimplemented by a processor by executing a software instruction. Thesoftware instruction may include a corresponding software module. Thesoftware module may be stored in a random access memory (Random AccessMemory, RAM), a flash memory, a read-only memory (Read Only Memory,ROM), an erasable programmable read only memory (Erasable ProgrammableROM, EPROM), an electrically erasable programmable read only memory(Electrically EPROM, EEPROM), a register, a hard disk, a mobile harddisk, a compact disc read-only memory (CD-ROM), or any other form ofstorage medium well-known in the art. For example, a storage medium iscoupled to a processor, so that the processor can read information fromthe storage medium or write information into the storage medium.Certainly, the storage medium may be a component of the processor. Theprocessor and the storage medium may be located in the ASIC. Inaddition, the ASIC may be located in a core network interface device.Certainly, the processor and the storage medium may exist in the corenetwork interface device as discrete components.

A person skilled in the art should be aware that in the foregoing one ormore examples, functions described in this application may beimplemented by hardware, software, firmware, or any combination thereof.When the present invention is implemented by software, the foregoingfunctions may be stored in a computer-readable medium or transmitted asone or more instructions or code in the computer-readable medium. Thecomputer-readable medium includes a computer storage medium and acommunications medium, where the communications medium includes anymedium that enables a computer program to be transmitted from one placeto another The storage medium may be any available medium accessible toa general-purpose or dedicated computer.

The objectives, technical solutions, and benefits of this applicationare further described in detail in the foregoing specific embodiments.It should be understood that the foregoing descriptions are merelyspecific embodiments of this application, but are not intended to limitthe protection scope of this application. Any modification, equivalentreplacement or improvement made based on the technical solutions in thisapplication shall fall within the protection scope of this application.

1.-19. (canceled)
 20. A positioning method implemented by an electronicdevice, the method comprising: determining identifiers of target signalsources, wherein the target signal sources have signal strengths thatcan be detected by the electronic device and that are greater than apreset threshold; determining a current signal source integratedidentifier based on the identifiers, wherein the current signal sourceintegrated identifier comprises the identifiers; searching a storedmapping relationship for a target signal source integrated identifierthat has a similarity to the current signal source integrated identifierthat satisfies a preset condition; determining a location correspondingto the target signal source integrated identifier; and performingsatellite positioning based on the location.
 21. The positioning methodof claim 20, wherein determining the current signal source integratedidentifier comprises: sequentially arranging the identifiers based onsignal strengths of the target signal sources to determine sequentiallyarranged identifiers; and generating the current signal sourceintegrated identifier based on the sequentially arranged identifiers.22. The positioning method of claim 20, wherein the target signal sourceintegrated identifier has the similarity to the current signal sourceintegrated identifier that satisfies the preset condition when thetarget signal source integrated identifier comprises at least N samesignal source identifiers as the current signal source integratedidentifier, wherein there are M target signal sources, wherein M is aninteger greater than one, and wherein a value of N is an integer greaterthan or equal to one and less than or equal to M.
 23. The positioningmethod of claim 22, wherein the preset condition further comprises thetarget signal source integrated identifier being a signal sourceintegrated identifier having a largest quantity of same signal sourceidentifiers as the current signal source integrated identifier whenthere are at least two signal source integrated identifiers eachcomprising the at least N same signal source identifiers as the currentsignal source integrated identifier, and wherein the target signalsource integrated identifier is one of the at least two signal sourceintegrated identifiers.
 24. The positioning method of claim 22, furthercomprising storing establishment times of mapping relationships betweensignal source integrated identifiers and corresponding locations,wherein the preset condition further comprises the target signal sourceintegrated identifier being a signal source integrated identifier havinga latest establishment time of the establishment times when there are atleast two signal source integrated identifiers each comprising the atleast N same signal source identifiers as the current signal sourceintegrated identifier, and wherein the target signal source integratedidentifier is one of the at least two signal source integratedidentifiers.
 25. The positioning method of claim 20, wherein afterperforming the satellite positioning, the method further comprises:determining whether a mapping relationship corresponding to the currentsignal source integrated identifier is locally stored; and updating acurrent location of the electronic device obtained after the satellitepositioning to a location corresponding to the current signal sourceintegrated identifier when the mapping relationship corresponding to thecurrent signal source integrated identifier is locally stored.
 26. Thepositioning method of claim 25, wherein the method further comprisesstoring a mapping relationship between the current signal sourceintegrated identifier and the current location of the electronic deviceobtained after the satellite positioning when the mapping relationshipcorresponding to the current signal source integrated identifier is notlocally stored.
 27. An electronic device, comprising: a processor; and amemory coupled to the processor and configured to store programminginstructions that, when executed by the processor, cause the electronicdevice to: determine identifiers of target signal sources, wherein thetarget signal sources have signal strengths that can be detected by theelectronic device and that are greater than a preset threshold;determine a current signal source integrated identifier based on theidentifiers, wherein the current signal source integrated identifiercomprises the identifiers; search a stored mapping relationship for atarget signal source integrated identifier that has a similarity to thecurrent signal source integrated identifier that satisfies a presetcondition; determine a location corresponding to the target signalsource integrated identifier; and perform satellite positioning based onthe location.
 28. The electronic device of claim 27, wherein theelectronic device determines the current signal source integratedidentifier based on the identifiers and is further configured to:sequentially arrange the identifiers of the target signal sources basedon signal strengths of the target signal sources to determinesequentially arranged identifiers; and generate the current signalsource integrated identifier according to the sequentially arrangedidentifiers.
 29. The electronic device of claim 27, wherein the targetsignal source integrated identifier has the similarity to the currentsignal source integrated identifier that satisfies the preset conditionwhen the target signal source integrated identifier comprises at least Nsame signal source identifiers as the current signal source integratedidentifier, wherein there are M target signal sources, wherein M is aninteger greater than one, and wherein a value of N is an integer greaterthan or equal to one and less than or equal to M.
 30. The electronicdevice of claim 29, wherein the preset condition further comprises thetarget signal source integrated identifier being a signal sourceintegrated identifier having a largest quantity of same signal sourceidentifiers as the current signal source integrated identifier whenthere are at least two signal source integrated identifiers eachcomprising the at least N same signal source identifiers as the currentsignal source integrated identifier, and wherein the target signalsource integrated identifier is one of the at least two signal sourceintegrated identifiers.
 31. The electronic device of claim 29, whereinthe electronic device is further configured to store establishment timesof mapping relationships between signal source integrated identifiersand corresponding locations, wherein the preset condition furthercomprises the target signal source integrated identifier being a signalsource integrated identifier having a latest establishment time of theestablishment times when there are at least two signal source integratedidentifiers each comprising the at least N same signal sourceidentifiers as the current signal source integrated identifier, andwherein the target signal source integrated identifier is one of the atleast two signal source integrated identifiers.
 32. The electronicdevice of claim 27, wherein the electronic device is further configuredto: determine whether a mapping relationship corresponding to thecurrent signal source integrated identifier is locally stored; andupdate a current location of the electronic device obtained after thesatellite positioning to a location corresponding to the current signalsource integrated identifier when the mapping relationship correspondingto the current signal source integrated identifier is locally stored.33. The electronic device of claim 32, wherein the electronic device isfurther configured to store a mapping relationship between the currentsignal source integrated identifier and the current location of theelectronic device obtained after the satellite positioning when themapping relationship corresponding to the current signal sourceintegrated identifier is not locally stored.
 34. A computer programproduct comprising computer-executable instructions stored on anon-transitory computer-readable medium that, when executed by aprocessor, cause an electronic device to: determine identifiers oftarget signal sources, wherein the target signal sources have signalstrengths that can be detected by the electronic device and that aregreater than a preset threshold; determine a current signal sourceintegrated identifier based on the identifiers, wherein the currentsignal source integrated identifier comprises the identifiers of thetarget signal sources; search a stored mapping relationship for a targetsignal source integrated identifier that has a similarity to the currentsignal source integrated identifier that satisfies a preset condition;determine a location corresponding to the target signal sourceintegrated identifier; and perform satellite positioning based on thelocation.
 35. The computer program product of claim 34, wherein thecomputer-executable instructions cause the electronic device todetermine the current signal source integrated identifier based on theidentifiers by causing the electronic device to: sequentially arrangethe identifiers based on signal strengths of the target signal sourcesto determine sequentially arranged identifiers; and generate the currentsignal source integrated identifier according to the sequentiallyarranged identifiers.
 36. The computer program product of claim 34,wherein the target signal source integrated identifier has thesimilarity to the current signal source integrated identifier thatsatisfies the preset condition when the target signal source integratedidentifier comprises at least N same signal source identifiers as thecurrent signal source integrated identifier, wherein there are M targetsignal sources, wherein M is an integer greater than one, and wherein avalue of N is an integer greater than or equal to one and less than orequal to M.
 37. The computer program product of claim 36, wherein thepreset condition further comprises the target signal source integratedidentifier being a signal source integrated identifier that comprises alargest quantity of same signal source identifiers as the current signalsource integrated identifier when there are at least two signal sourceintegrated identifiers each comprising the at least N same signal sourceidentifiers as the current signal source integrated identifier, andwherein the target signal source integrated identifier is one of the atleast two signal source integrated identifiers.
 38. The computer programproduct of claim 36, wherein the computer program product is furtherconfigured to store establishment times of mapping relationships betweensignal source integrated identifiers and corresponding locations,wherein the preset condition further comprises the target signal sourceintegrated identifier being a signal source integrated identifier havinga latest establishment time of the establishment times when there are atleast two signal source integrated identifiers each comprising the atleast N same signal source identifiers as the current signal sourceintegrated identifier, and wherein the target signal source integratedidentifier is one of the at least two signal source integratedidentifiers.
 39. The computer program product of claim 34, wherein thecomputer-executable instructions are further configured to cause theelectronic device to: determine whether a mapping relationshipcorresponding to the current signal source integrated identifier islocally stored; and update a current location of the electronic deviceobtained after the satellite positioning to a location corresponding tothe current signal source integrated identifier when the mappingrelationship corresponding to the current signal source integratedidentifier is locally stored.